<template>
  <div class="tcm-prescription-box">
    <div class="tcm-title">中药处方一</div>
    <div class="tcm-header-row">
      <span>总量：<span>22</span></span>
      <span>已发：<span class="tcm-blue">33</span></span>
      <span>本次发：<span class="tcm-blue tcm-bold">55</span></span>
      <span>煎服</span>
      <span>1日1次</span>
      <span>1次100ml</span>
      <span>备注</span>
    </div>
    <div class="tcm-divider"></div>
    <div class="tcm-herb-list">
      <div v-for="(herb, idx) in herbs" :key="idx">
        <div class="tcm-herb-item">
          <div class="herb-name tcm-herb-item_1">{{ herb.name }}</div>
          <div class="tcm-herb-item_2">
            <span class="herb-amount">{{ herb.amount }}</span>
            <span class="herb-unit">g</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const herbs = ref([
  {
    name: '大枣',
    amount: '10',
  },
  {
    name: '大枣',
    amount: '10',
  },
  {
    name: '大枣',
    amount: '10',
  },
  {
    name: '大枣',
    amount: '10',
  },
  {
    name: '大枣',
    amount: '10',
  },
]);
</script>

<style scoped>
.tcm-prescription-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px 0 #e9e9e9;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.tcm-title {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  background: #f8f8f8;
  height: 48px;
  line-height: 48px;
  padding: 0 24px;
  border-radius: 12px 12px 0 0;
}
.tcm-header-row {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 48px;
  background: #fff;
  font-size: 15px;
  color: #666;
  gap: 24px;
}
.tcm-header-row span {
  display: flex;
  align-items: center;
}
.tcm-blue {
  color: #16ada4;
}
.tcm-bold {
  font-weight: 700;
}
.tcm-divider {
  border-bottom: 1px solid #f0f0f0;
  margin: 0 0 0 0;
}
.tcm-herb-list {
  display: flex;
  gap: 24px;flex-wrap: wrap;
  padding: 24px;
}
.tcm-herb-item {
  display: flex;
  align-items: center;
  border-radius: 8px;
  font-size: 16px;
  color: #222;
  min-width: 120px;
  border: 1px solid #e6e6e6;
}
.tcm-herb-item_1 {
  display: flex;
  align-items: center;
  background: #fafbfc;
  border-right: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  color: #222;
  min-width: 120px;
  justify-content: center;
}
.tcm-herb-item_2 {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  color: #222;
  min-width: 120px;
  justify-content: center;
}
.tcm-herb-item + .tcm-herb-item {
  margin-left: 16px;
}
.herb-name {
}
.herb-amount {
  margin-right: 4px;
}
</style>
